package com.mifengs.mall.floor;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseViewHolder;
import com.chad.library.adapter.base.annotation.ItemProviderTag;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.mifengs.mall.R;
import com.mifengs.mall.entity.AdvertBean;
import com.mifengs.mall.entity.FloorBean;
import com.mifengs.mall.util.ImageLoadUtil;

/**
 * Created by lynn on 2018/4/19.
 */
@ItemProviderTag(
        viewType = FloorListAdapter.TYPE_NICE,
        layout = R.layout.item_title
)
public class FloorNiceItemProvider extends BaseItemProvider<FloorBean,BaseViewHolder> {
    @Override
    public void convert(BaseViewHolder viewHolder, final FloorBean floorBean, int index) {
        ImageView titleView = viewHolder.getView(R.id.iv_title);
        if(floorBean !=null){
            for(int i = 0;i<floorBean.getAdverts().size();i++ ){
                AdvertBean adverts = floorBean.getAdverts().get(i);
                ImageLoadUtil.displayImage(mContext,adverts.getImg(),titleView);
            }
        }
    }

    @Override
    public void onClick(BaseViewHolder baseViewHolder, FloorBean floorBean, int i) {

    }

    @Override
    public boolean onLongClick(BaseViewHolder baseViewHolder, FloorBean floorBean, int i) {
        return false;
    }
}
